A Translation from Attribute Grammars to Catamorphisms
نویسندگان
چکیده
Let AG be an attribute grammar, with underlying context free grammar G and attribute evaluation rules A . The function that decorates —according to A— a parse tree with attribute values and then delivers the synthesized attribute value of the root node, is denoted [[A]] . We translate G into a functor F such that any parse tree for G is an element of the initial F -algebra. The attribute evaluation rules A are translated to a function φ such that ([F| φ]) is, in a precise sense, equivalent to [[A]] .
منابع مشابه
From Attribute Grammars to Constraint Handling Rules
Attribute grammars provide a framework to define computations over trees, by decorating those trees with attributes. Attribute grammars have been successfully applied in many areas, including compiler construction and natural language processing. In this paper we present a translation of attribute grammars to Constraint Handling Rules, a formalism based on constraint rewriting. Our translation ...
متن کاملCan we transform logic programs into attribute grammars?
In this paper we study the relationship between Attribute Grammars and Logic Programs, concentrating on transforming logic programs into attribute grammars. This has potential applications in compilation techniques for logic programs. It does not seem possible to transform arbitrary Logic Programs into Attribute Grammars, basically because the same logic variables can sometimes be used as input...
متن کاملAttributed Translation and the Semantics of Natural Language
When Knuth introduced attribute grammars, he observed that although \oriented primarily towards programming languages, the same methods appear to be relevant also in the study of natural languages". We demonstrate that his intuition is computationally justiiable, based on the algebraic equivalence of attribute grammars and Montague's theory of Universal Grammar. We discuss the relationship betw...
متن کاملAutomatic Translation With Attribute Grammars
Starting from an ATN-grammar and translation rules assigning expressions of a predicate calculus language to the symbols of the grammar one can produce an attribute grammar for the translation of natural language sentences (here German) into expressions of the predicate calculus language. The paper illustrates that this can be done in a straightforward way and outlines further improvements of t...
متن کاملA systematic approach to the implementation of attribute grammars with conventional compiler construction tools
This article describes structure-preserving coding patterns to code arbitrary non-circular attribute grammars as syntax-directed translation schemes for bottom-up and top-down parser generation tools. In these translation schemes, semantic actions are written in terms of a small repertory of primitive attribution operations. By providing alternative implementations for these attribution operati...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1990